package com.ruoyi.admin.domain;

import java.math.BigDecimal;
import java.util.Objects;

/**
 * 仪表盘数据统计类
 * 用于封装首页数据看板的各类统计指标
 * 
 * @author ouran
 * @date 2025-06-16
 */
public class NameDataPanel {
    // 今日统计
    private BigDecimal todayEarnings; // 今日预估收益
    private Integer todayOrders; // 今日付款订单
    private BigDecimal todayGmv; // 今日交易额

    // 昨日统计
    private BigDecimal yesterdayEarnings; // 昨日预估收益
    private Integer yesterdayOrders; // 昨日付款订单
    private BigDecimal yesterdayGmv; // 昨日交易额

    // 本月统计
    private BigDecimal monthEarnings; // 本月预估收益
    private Integer monthOrders; // 本月付款订单
    private BigDecimal monthGmv; // 本月交易额

    // 上月统计
    private BigDecimal lastMonthEarnings; // 上月预估收益
    private Integer lastMonthOrders; // 上月付款订单
    private BigDecimal lastMonthGmv; // 上月交易额

    // 本年统计
    private BigDecimal yearEarnings; // 本年预估收益

    // 账户信息
    private BigDecimal balance = BigDecimal.ZERO; // 账户余额
    private BigDecimal withdrawable = BigDecimal.ZERO; // 可提现金额

    // Getters and Setters
    public BigDecimal getTodayEarnings() {
        return todayEarnings;
    }

    public void setTodayEarnings(BigDecimal todayEarnings) {
        this.todayEarnings = todayEarnings;
    }

    public Integer getTodayOrders() {
        return todayOrders;
    }

    public void setTodayOrders(Integer todayOrders) {
        this.todayOrders = todayOrders;
    }

    public BigDecimal getTodayGmv() {
        return todayGmv;
    }

    public void setTodayGmv(BigDecimal todayGmv) {
        this.todayGmv = todayGmv;
    }

    public BigDecimal getYesterdayEarnings() {
        return yesterdayEarnings;
    }

    public void setYesterdayEarnings(BigDecimal yesterdayEarnings) {
        this.yesterdayEarnings = yesterdayEarnings;
    }

    public Integer getYesterdayOrders() {
        return yesterdayOrders;
    }

    public void setYesterdayOrders(Integer yesterdayOrders) {
        this.yesterdayOrders = yesterdayOrders;
    }

    public BigDecimal getYesterdayGmv() {
        return yesterdayGmv;
    }

    public void setYesterdayGmv(BigDecimal yesterdayGmv) {
        this.yesterdayGmv = yesterdayGmv;
    }

    public BigDecimal getMonthEarnings() {
        return monthEarnings;
    }

    public void setMonthEarnings(BigDecimal monthEarnings) {
        this.monthEarnings = monthEarnings;
    }

    public Integer getMonthOrders() {
        return monthOrders;
    }

    public void setMonthOrders(Integer monthOrders) {
        this.monthOrders = monthOrders;
    }

    public BigDecimal getMonthGmv() {
        return monthGmv;
    }

    public void setMonthGmv(BigDecimal monthGmv) {
        this.monthGmv = monthGmv;
    }

    public BigDecimal getLastMonthEarnings() {
        return lastMonthEarnings;
    }

    public void setLastMonthEarnings(BigDecimal lastMonthEarnings) {
        this.lastMonthEarnings = lastMonthEarnings;
    }

    public Integer getLastMonthOrders() {
        return lastMonthOrders;
    }

    public void setLastMonthOrders(Integer lastMonthOrders) {
        this.lastMonthOrders = lastMonthOrders;
    }

    public BigDecimal getLastMonthGmv() {
        return lastMonthGmv;
    }

    public void setLastMonthGmv(BigDecimal lastMonthGmv) {
        this.lastMonthGmv = lastMonthGmv;
    }

    public BigDecimal getYearEarnings() {
        return yearEarnings;
    }

    public void setYearEarnings(BigDecimal yearEarnings) {
        this.yearEarnings = yearEarnings;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public BigDecimal getWithdrawable() {
        return withdrawable;
    }

    public void setWithdrawable(BigDecimal withdrawable) {
        this.withdrawable = withdrawable;
    }

    /**
     * 设置默认值防止null
     */
    public void setDefaultValues() {
        this.todayEarnings = (this.todayEarnings != null) ? this.todayEarnings : BigDecimal.ZERO;
        this.todayOrders = (this.todayOrders != null) ? this.todayOrders : 0;
        this.todayGmv = (this.todayGmv != null) ? this.todayGmv : BigDecimal.ZERO;

        this.yesterdayEarnings = (this.yesterdayEarnings != null) ? this.yesterdayEarnings : BigDecimal.ZERO;
        this.yesterdayOrders = (this.yesterdayOrders != null) ? this.yesterdayOrders : 0;
        this.yesterdayGmv = (this.yesterdayGmv != null) ? this.yesterdayGmv : BigDecimal.ZERO;

        this.monthEarnings = (this.monthEarnings != null) ? this.monthEarnings : BigDecimal.ZERO;
        this.monthOrders = (this.monthOrders != null) ? this.monthOrders : 0;
        this.monthGmv = (this.monthGmv != null) ? this.monthGmv : BigDecimal.ZERO;

        this.lastMonthEarnings = (this.lastMonthEarnings != null) ? this.lastMonthEarnings : BigDecimal.ZERO;
        this.lastMonthOrders = (this.lastMonthOrders != null) ? this.lastMonthOrders : 0;
        this.lastMonthGmv = (this.lastMonthGmv != null) ? this.lastMonthGmv : BigDecimal.ZERO;

        this.yearEarnings = (this.yearEarnings != null) ? this.yearEarnings : BigDecimal.ZERO;
    }
}
